cfg

E = figure
hold on
grid on
xlabel('t[ms]')
ylabel('E[V/m]');
H = figure
hold on
grid on
xlabel('t[ms]')
ylabel('H[A/m]')
colors = {'r', 'g', 'b', 'c', 'm', 'y', 'k', 'r', 'g', 'b', 'c', 'm', 'y', 'k'};
Ec = 1
Hc = 1
for k = 1:length(signals)
	field = signals{k,1};
	name = signals{k,2};
	filename = signals{k,3};
	if strcmp(field, 'E')
		figure(E)
		cl1 = colors{Ec};
		cl2 = colors{Ec + 1};
		Ec += 2
	else
		figure(H)
		cl1 = colors{Hc};
		cl2 = colors{Hc + 1};
		Hc += 2
	end
	load([filename, '.dat'])
	eval(['sig = ', filename, ';'])
	
	plot(sig(:,1)*1000, sig(:,2), [cl1, ';bezier ', name, ';']);
	
	% We are cheaters ^^, we know tat in ../zagagulja/ we have same signals, calculated 
	% for piece-linear trajectory
	load(['../zagagulja/' ,filename, '.dat'])
	eval(['sig = ', filename, ';'])
	plot(sig(:,1)*1000, sig(:,2), [cl2, ';linear ', name, ';']);
end
figure(E)
print('-depsc', 'E_bezier_zagagulja.eps');
figure(H)
print('-depsc', 'H_bezier_zagagulja.eps');



